package top.anydata.lifeofcode.lifesystem.entity.sys.user;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;
import java.util.Objects;

/**
 * 功能描述: 权限角色表
 *
 * @author <a href="mailto:caingao@anydata.top">CainGao</a>
 * @version V_1.0
 * @date 2023/8/31 5:43 PM
 */
@Data
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "sys_auth_permission", schema = "life_system_admin", catalog = "")
public class SysAuthPermissionEntity {
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Id
    @Column(name = "id")
    private Integer id;
    @Basic
    @Column(name = "name")
    private String name;
    @Basic
    @Column(name = "description")
    private String description;
    @Basic
    @Column(name = "path")
    private String path;
    @Basic
    @Column(name = "url")
    private String url;
    @Basic
    @Column(name = "parent_id")
    private String parentId;
    @Basic
    @Column(name = "order")
    private Integer order;
    @Basic
    @Column(name = "icon")
    private String icon;
    @Basic
    @Column(name = "type")
    private Integer type;
    @Basic
    @Column(name = "is_deleted")
    private Byte isDeleted;
    @Basic
    @Column(name = "create_time")
    private Timestamp createTime;
    @Basic
    @Column(name = "update_time")
    private Timestamp updateTime;
    @Basic
    @Column(name = "remarks")
    private String remarks;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SysAuthPermissionEntity that = (SysAuthPermissionEntity) o;
        return id == that.id && order == that.order && icon == that.icon && type == that.type && Objects.equals(name, that.name) && Objects.equals(description, that.description) && Objects.equals(path, that.path) && Objects.equals(url, that.url) && Objects.equals(parentId, that.parentId) && Objects.equals(isDeleted, that.isDeleted) && Objects.equals(createTime, that.createTime) && Objects.equals(updateTime, that.updateTime) && Objects.equals(remarks, that.remarks);
    }

    @Override
    public int hashCode()
    {
        return Objects.hash(id, name, description, path, url, parentId, order, icon, type, isDeleted, createTime, updateTime, remarks);
    }
}
